package com.bookshop.ui.component;

import java.awt.Image;

import javax.swing.ImageIcon;

import com.bookshop.logic.ImageCoding;

public class MyImageIcon extends ImageIcon {
	private final byte[] mBytes;
	public MyImageIcon(byte[] bytes) {
		super(bytes);
		mBytes = bytes;
	}
	
	public MyImageIcon(String pPath) {
		super(pPath);
		mBytes = ImageCoding.imageDecode(pPath);
	}
	
	public MyImageIcon(Image pImage, byte[] pBytes) {
		super(pImage);
		mBytes = pBytes;
	}
	
	public byte[] getImageData() {
		return mBytes;
	}
}
